#include "myudp.h"

MyUdp::MyUdp(QObject *parent) :
    QThread(parent)
{
     initUdp();
     udpLink->udpBroadLink = new QUdpSocket();
     udpLink->udpBroadLink->bind(6999,QUdpSocket::ShareAddress);
     QObject::connect(udpLink->udpBroadLink,SIGNAL(readyRead()),this,SLOT(udpRecProcess()));
}

void MyUdp::initUdp()
{
    sysInfo = new systemFile();
    udpLink = new udpSocket(sysInfo);
    //链接数据库
}

void MyUdp::udpRecProcess()
{
     qDebug() << "udpRec";
    udpLink->udp_broadcast_reciver_data();
}


void MyUdp::run()
{
    //udpLink->udpBroadLink = new QUdpSocket();
   // udpLink->udpBroadLink->bind(6996,QUdpSocket::ShareAddress);
    //QObject::connect(udpLink->udpBroadLink,SIGNAL(readyRead()),this,SLOT(udpRecProcess()));
    qDebug()<<"asd";
}
